package model.commands;

import exceptions.TalkToPerson;
import exceptions.ThingNotInArea;
import view.input.InputWords;
import model.commands.Command;
import model.locations.World;
import model.locations._World;
import model.things.Thing;

public class TalkToCommand extends Command{

	_World world;
	public TalkToCommand(_World world) {
		this.world=world;
	}

	
	// if a Correct person is TalkedTo then TalkTo person exception is thrown
	public String execute(InputWords words) throws TalkToPerson {
		
		//you can only talk to main characters or extras
		//sometimes the same person will be in the context of a friend or enemy. depends on stage of game.
		if (world.getThing(words.getWord2(),"MAIN")||world.getThing(words.getWord2(),"EXTRA"))
		throw new TalkToPerson(words.getWord2());
		return words.getWord2()+" is not here";
	}

}